
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>{{ book.book_name }}_{{ book.author_name }}_{{ book.book_name }}txt下载_{{ book.book_name }}无弹窗_{{ website.name }}</title>
    <meta name="keywords" content="{{ book.book_name }}官方首发,{{ book.book_name }}小说,{{ book.book_name }}最新章节{{ book.book_name }}txt下载,{{ book.book_name }}无弹窗,{{ book.book_name }}吧,{{ book.book_name }}离线完本"/>
    <meta name="description" content="{{ book.book_name }},{{ book.book_name }}小说阅读,{{ book.book_name }}由作家{{ book.author_name }}创作,{{ website.name }}提供{{ book.book_name }}首发最新章节及txt下载,{{ book.book_name }}最新更新章节,精彩尽在{{ website.name }}。"/>
    <link rel="stylesheet" href="/static/css/main.css"/>
    <link href="/static/css/book.css?v=2019" rel="stylesheet"/>

    {% include 'common/header.html' %}

</head>
<body>

<input type="hidden" id="lastBookIndexId" value="{{ book.last_index_id if book.last_index_id else '' }}"/>
<input type="hidden" id="bookCatId" value="{{ book.cat_id }}"/>
<input type="hidden" id="bookId" value="{{ book.id }}"/>
<input type="hidden" id="preContentId" value="{{ first_book_index_info.first_book_index_id }}"/>

{% include 'common/top.html' %}

<div class="main box_center cf mb50">
    <div class="nav_sub">
        <a href="/">{{ website.name }}</a>&gt;<a href="/book/bookclass.html?c={{ book.cat_id }}">{{ book.cat_name }}</a>&gt;<a
            href="/book/{{ book.id }}.html">{{ book.book_name }}</a>
    </div>
    <div class="channelWrap channelBookInfo cf">
        <div class="bookCover cf">
            <a href="{{ book.pic_url }}" class="book_cover"><img class="cover" src="{{ book.pic_url }}" alt="{{ book.book_name }}"/></a>
            <div class="book_info">
                <div class="tit">
                    <h1>{{ book.book_name }}</h1><!--<i class="vip_b">VIP</i>--><a class="author">{{ book.author_name }} 著</a>
                </div>
                <ul class="list">
                    <li><span class="item">类别：<em>{{ book.cat_name }}</em></span>
                        {% if book.book_status == 0 %}
                        <span class="item">状态：<em>连载中</em></span>
                        {% else %}
                        <span class="item">状态：<em>已完结</em></span>
                        {% endif %}
                        <span class="item">总点击：<em id="cTotal">{{ book.visit_count }}</em></span>
                        <span class="item">总字数：<em>{{ book.word_count }}</em></span></li>
                </ul>
                <div class="intro_txt">
                    <p>{{ book.book_desc | safe }}</p>
                    <a class="icon_hide" href="javascript:void(0)" onclick=""><i></i>收起</a>
                    <a class="icon_show" href="javascript:void(0)" onclick=""><i></i>展开</a>
                </div>
                <div class="btns" id="optBtn">
                    <a href="/book/{{ book.id }}/{{ first_book_index_info.first_book_index_id }}.html" class="btn_ora">{{ first_book_index_info.read_button_text }}</a>
                    <span id="cFavs"><a href="javascript:void(0);" class="btn_ora_white btn_addsj"
                                        onclick="javascript:BookDetail.AddFavorites(37,0,0);">加入书架</a>
                    </span>
                </div>
            </div>
        </div>
    </div>

    <div class="channelBookContent cf">
        <!--left start-->
        <div class="wrap_left fl">
            <div class="wrap_bg">

                <!--章节目录 start-->
                <div class="pad20_nobt">
                    <div class="bookChapter">
                        <div class="book_tit">
                            <div class="fl">
                                <h3>最新章节</h3><span id="bookIndexCount">(0章)</span></div>
                            <a class="fr" href="/book/indexList-{{ book.id }}.html">全部目录</a>
                        </div>
                        <ul class="list cf">
                            <li>
                                <span class="fl font16"> <a href="/book/{{ book.id }}/{{ book.last_index_id }}.html">{{ book.last_index_name }}</a></span>
                                <span class="black9 fr">更新时间：
                                    {% if book.last_index_update_time %}
                                        {{ book.last_index_update_time.strftime("%Y-%m-%d %H:%M:%S") }}
                                    {% else %}
                                    {% endif %}
                                </span>
                            </li>
                            <li class="zj_yl" id="lastBookContent"> 　</li>
                            <!--此处是该章节预览，截取最前面的42个字-->
                        </ul>
                    </div>
                </div>
                <!--章节目录 end-->

                {% if book.comment_enabled == 1 %}
                <!--作品评论区 start-->
                <div class="pad20">
                    <div class="bookComment">
                        <div class="book_tit">
                            <div class="fl">
                                <h3>作品评论区</h3><span id="bookCommentTotal">({{ comments_count }}条)</span>
                            </div>
                            <a class="fr" href="#txtComment">发表评论</a>
                        </div>
                        <div class="no_comment" id="noCommentPanel" style="{% if page_comments.total > 0 %}display:none{% endif %}">
                            <img src="/static/images/no_comment.png" alt=""/>
                            <span class="block">暂无评论</span>
                        </div>
                        <div class="commentBar" id="commentPanel" style="{% if page_comments.total == 0 %}display:none{% endif %}">
                            {% for comment in page_comments.items %}
                                <div class="comment_list cf">
                                    <div class="user_heads fl" vals="389">
                                        <img src="{% if comment.create_user_photo %}{{ comment.create_user_photo }}{% else %}/static/images/man.png{% endif %}" class="user_head" alt="">
                                        <span class="user_level1" style="display: none;">见习</span></div><ul class="pl_bar fr">
                                    <li class="name">
                                        {{ comment.create_user_name }}
                                    </li>
                                    <li class="dec">{{ comment.comment_content }}</li>
                                    <li class="other cf">
                                        <span class="time fl">{{ comment.create_time.strftime("%Y-%m-%d %H:%M:%S") }}
                                        </span>
                                    <span class="fr">
                                        <a href="javascript:void(0);" onclick="javascript:BookDetail.AddAgreeTotal(77,this);" class="zan" style="display: none;">赞<i class="num">(0)</i></a></span></li>		</ul>	</div>
                            {% endfor %}
                        </div>

                        <!--无评论时此处隐藏-->
                        <div class="more_bar" id="moreCommentPanel" style="{% if page_comments.total == 0 %}display:none{% endif %}">
                            <a href="/book/comment-{{ book.id }}.html">查看全部评论&gt;</a>
                        </div>

                        <div class="reply_bar" id="reply_bar">
                            <div class="tit">
                                <span class="fl font16">发表评论</span>
                                <!--未登录状态下不可发表评论，显示以下链接-->
                                <span class="fr black9" style="display:none; ">请先 <a class="orange"
                                                                                     href="/user/login.html">登录</a><em
                                        class="ml10 mr10">|</em><a class="orange"
                                                                   href="/user/register.html">注册</a></span>
                            </div>
                            <textarea name="txtComment" rows="2" cols="20" id="txtComment" class="replay_text"
                                      placeholder="我来说两句..."></textarea>
                            <div class="reply_btn">
                                <span class="fl black9"><em class="ml5" id="emCommentNum">0/1000</em> 字</span>
                                <span class="fr"><a class="btn_ora" href="javascript:void(0);"
                                                    onclick="javascript:BookDetail.SaveComment(37,0,$('#txtComment').val());">发表</a></span>
                            </div>
                        </div>

                    </div>
                </div>
                <!--作品评论区 end-->
                {% else %}
                <h5>评论区已关闭</h5>
                {% endif %}

            </div>
        </div>
        <!--left end-->

        <!--right start-->
        <div class="wrap_right fr">


            <script src="/static/javascript/authorinfo.js?uid=8" type="text/javascript"></script>
            <!--作者专栏s-->
            <div class="wrap_inner author_info mb20">

                <div class="author_head cf">
                    <a href="javascript:void(0);" class="head">
                        {% if author_avatar %}
                        <img src="{{ author_avatar }}" alt="作者头像" id="authorLogoImg"/>
                        {% else %}
                        <img src="/static/images/author_head.png" alt="作者头像" id="authorLogoImg"/>
                        {% endif %}
                    </a>
                    <div class="msg">
                        <span class="icon_qyzz">签约作家</span>
                        <h4><a href="javascript:searchByAuthorId(&#39;{{ book.author_id }}&#39;)">{{ book.author_name }}</a></h4>
                        {% if follow_status == 1 %}
                        <span id="followAuthor" onclick="javascript:BookDetail.FollowAuthor({{ book.author_id }}, 0);">已关注</span>
                        {% elif follow_status == 0 %}
                        <span id="followAuthor" class="icon_qyzz" onclick="javascript:BookDetail.FollowAuthor({{ book.author_id }}, 1);">关注</span>
                        {% else %}
                        <span id="followAuthor" class="icon_qyzz" onclick="javascript:location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href)">登录后关注</span>
                        {% endif %}
                    </div>
                </div>
                <div class="author_intro cf">
                    <h4>作者有话说</h4>
                    <div class="intro_txt" id="authorNote">
                        亲亲们，你们的支持是我最大的动力！求点击、求推荐、求书评哦！
                    </div>
                </div>
                <!--如果作者没有其他作品就下方代码整个不显示-->


            </div>
            <!--作者专栏e-->
            <script type="text/javascript">
                var authorUId = 8;
                if (authorUId == 0) {
                    $("#authorPanel").hide();
                } else {
                }
            </script>

            <div id="RelateBookOther" class="wrap_inner wrap_right_cont mb20">
                <div class="title cf">
                    <h3 class="on">同类推荐</h3>
                </div>
                <div class="tj_bar">
                    <ul id="recBookList">
                        {% for book in rec_books %}
                            <li>
                                <div class="book_intro">
                                    <div class="cover">
                                        <a href="/book/{{ book.id }}.html"><img src="{{ book.pic_url }}" alt="{{ book.book_name }}"></a>
                                    </div>
                                    <div class="dec">
                                        <a class="book_name" href="/book/{{ book.id }}.html">{{ book.book_name }}</a>
                                        <a class="txt" href="/book/{{ book.id }}.html">{{ book.book_desc | safe }}</a>
                                    </div>
                                </div>
                            </li>
                        {% endfor %}

                    </ul>
                </div>
            </div>
        </div>
        <!--right end-->
    </div>
</div>

{% include 'common/footer.html' %}
{% include 'common/js.html' %}

<script src="/static/javascript/bookdetail.js?v=1.1" type="text/javascript"></script>
<script src="/static/javascript/ufans.js?v=1" type="text/javascript"></script>


<div class="maskBox" style="display:none" onclick="javascript:uFans.closeBox();"></div>
<div class="readPopup pcBox" style="display:none" id="showPC"></div>
<div class="readPopup flowerBox" style="display:none" id="showFlower"></div>
<div class="readPopup newsTipBox" style="display:none;" id="showNote"></div>
<script type="text/javascript">
    var pathname = window.location.pathname;
    var bookId = pathname.substring(pathname.lastIndexOf("/") + 1, pathname.lastIndexOf("."))
    //查询章节信息
    var lastBookIndexId = $("#lastBookIndexId").val();
    if(lastBookIndexId){
        $.ajax({
            type: "get",
            url: "/book/queryBookIndexAbout",
            data: {'bookId': bookId, 'lastBookIndexId': lastBookIndexId},
            dataType: "json",
            success: function (data) {
                if (data.code == 0) {
                    var bookIndexData = data.data;
                    //console.log(bookIndexData);
                    $("#bookIndexCount").html("(" + bookIndexData.bookIndexCount + "章)");
                    $("#lastBookContent").html(bookIndexData.lastBookContent + "...");


                } else {
                    layer.alert(data.msg);
                }

            },
            error: function () {
                layer.alert('网络异常');
            }
        })
    }else{
        $("#optBtn").remove();
    }
</script>
<script language="javascript" type="text/javascript">
    //查询是否在书架
    $.ajax({
        type: "get",
        url: "/user/queryIsInShelf",
        data: {'bookId': $("#bookId").val()},
        dataType: "json",
        success: function (data) {
            if (data.code == 0) {
                if (data.data) {
                    $("#cFavs").html('<a class="btn_ora_white btn_addsj" href="javascript:void(0);">已在书架</a>');
                }


            } else if (data.code == 1001 || data.code == 1066) {
                //未登录或登录信息过期

            } else {
                layer.alert(data.msg);
            }

        },
        error: function () {
            layer.alert('网络异常');
        }
    })


    var currentBId = 37, spmymoney = 0;
    var relationStep = 0;
    var authorUId = 8;
    $(function () {
        $(".icon_show").click(function () {
            $(this).hide();
            $(".icon_hide").show();
            $(".intro_txt").innerHeight("auto");
        });
        $(".icon_hide").click(function () {
            $(this).hide();
            $(".icon_show").show();
            $(".intro_txt").innerHeight("");
        });



        $("#AuthorOtherNovel li").unbind("mouseover");

        $('#txtComment').on('input propertychange', function () {
            var count = $(this).val().length;
            $('#emCommentNum').html(count + "/1000");
            if (count > 1000) {
                $('#txtComment').val($('#txtComment').val().substring(0, 1000));
            }
        });

    });


    $.post("/book/addVisitCount", JSON.stringify({"bookId": bookId}), function () {
    });


    function loadCommentList(){
        {% if book.comment_enabled == 1 %}
        $.ajax({
            type: "get",
            url: "/book/listCommentByPage",
            data: {'bookId': $("#bookId").val()},
            dataType: "json",
            success: function (data) {
                if (data.code == 0) {
                    var commentList = data.data;
                    if (commentList.length > 0) {
                        $("#bookCommentTotal").html("("+data.count+"条)");
                        var commentListHtml = "";
                        for (var i = 0; i < commentList.length; i++) {
                            var comment = commentList[i];
                            commentListHtml +=
                            `
                            <div class="comment_list cf">
                                <div class="user_heads fl" vals="389">
                                    <img src="${comment.create_user_photo ? comment.create_user_photo : '/static/images/man.png'}" class="user_head" alt="">
                                    <span class="user_level1" style="display: none;">见习</span>
                                </div>
                                <ul class="pl_bar fr">
                                    <li class="name">${comment.create_user_name}</li>
                                    <li class="dec">${comment.comment_content}</li>
                                    <li class="other cf">
                                        <span class="time fl">${layui.util.toDateString(comment.create_time,  "yyyy-MM-dd HH:mm:ss")}</span>
                                        <span class="fr">
                                            <a href="javascript:void(0);" onclick="javascript:BookDetail.AddAgreeTotal(77,this);" class="zan" style="display: none;">赞<i class="num">(0)</i></a>
                                        </span>
                                    </li>
                                </ul>
                            </div>
                            `;
                        }
                        $("#commentPanel").html(commentListHtml);
                        $("#noCommentPanel").hide();
                        $("#commentPanel").show();
                        $("#moreCommentPanel").show();

                    } else {
                        $("#commentPanel").hide();
                        $("#moreCommentPanel").hide();
                        $("#noCommentPanel").show();
                    }


                } else {
                    layer.alert(data.msg);
                }

            },
            error: function () {
                layer.alert('网络异常');
            }
        })
        {% endif %}
    }
</script>
</body>
</html>
